import json
import pickle

import requests

def one():

    data = {
        'device_id': "s2",
        'user': "大山66",
        'message': "为什么",
        'role': "user",
    }


    # url = "http://127.0.0.1:5000/"
    url = "http://103.149.200.228:8081/"

    response = requests.get(url)

    print(response.text)
def send():

    data = {
        'device_id': "s2",
        'user': "大山66",
        'message': "",
        'role': "user",
    }

    # url = "http://127.0.0.1:5000/get"
    url = "http://103.149.200.228:8081/get"

    response = requests.post(url, json=json.dumps(data))

    print(response.text)


def get_btn_content():
    # url = "http://127.0.0.1:5000/getbtn"

    url = "http://103.149.200.228:8081/getbtn"


    response = requests.post(url)

    print(response.text)

def get_device_id():
    url = "http://127.0.0.1:5000/get_device_id"

    # url = "http://103.149.200.228:8081/getbtn"

    response = requests.post(url)

    print(response.text)


if __name__ == "__main__":
    send()
    # get_btn_content()
    # get_device_id()
    # one()


